<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" id="html">
    <head>
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <base href="<?= base_url(1); ?>" />
        <link type="text/css" href="css/main.css?v=<?= $config['version'] ?>" rel="stylesheet" />
    </head>
    <body>
        <?php include(VIEWPATH . 'common/main_header.php'); ?>
        <form action="" method="POST" id="rowForm">
            <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tablegrid tableedit">
                <tr>
                    <td><?= translate('ITEM_ID') ?>:</td>
                    <td><input type="text" name="row[id]" id="id" size="25" value="<?= $row['id'] ?>" /></td>
                </tr>
                <tr>
                    <td><?= translate('ITEM_NAME') ?>:</td>
                    <td><input type="text" name="row[name]" id="name" size="25" value="<?= $row['name'] ?>" /></td>
                </tr>
                <tr>
                    <td><?= translate('TYPE') ?>:</td>
                    <td><input type="text" name="row[itemType]" id="itemType" size="25" value="<?= $row['itemType'] ?>" /></td>
                </tr>
                <tr>
                    <td><?= translate('ITEM_COMPOSE') ?>:</td>
                    <td>
                        <input type="radio" name="row[canCompose]" value="1" <?= checkchecked(1, $row['canCompose']) ?> /> <?= translate('YES') ?>
                        <input type="radio" name="row[canCompose]" value="0" <?= checkchecked(0, $row['canCompose']) ?> /> <?= translate('NO') ?>
                    </td>
                </tr>
                <tr>
                    <td><?= translate('ITEM_QUALITY') ?>:</td>
                    <td><input type="text" name="row[quality]" id="quality" size="25" value="<?= $row['quality'] ?>" /></td>
                </tr>
                <tr>
                    <td><?= translate('COPPER') ?>:</td>
                    <td><input type="text" name="row[copperBuyPrice]" id="copperBuyPrice" size="25" value="<?= $row['copperBuyPrice'] ?>" /></td>
                </tr>
                <tr>
                    <td><?= translate('GESTE') ?>:</td>
                    <td><input type="text" name="row[gesteBuyPrice]" id="gesteBuyPrice" size="25" value="<?= $row['gesteBuyPrice'] ?>" /></td>
                </tr>
                <tr>
                    <td><?= translate('GOLD') ?>:</td>
                    <td><input type="text" name="row[goldBuyPrice]" id="goldBuyPrice" size="25" value="<?= $row['goldBuyPrice'] ?>" /></td>
                </tr>
                <tr>
                    <td><?= translate('ITEM_DESC_1') ?>:</td>
                    <td><textarea name="row[desc1]" id="desc1" cols="50" rows="2"><?= $row['desc1'] ?></textarea></td>
                </tr>
                <tr>
                    <td><?= translate('ITEM_DESC_2') ?>:</td>
                    <td><textarea name="row[desc2]" id="desc2" cols="50" rows="2"><?= $row['desc2'] ?></textarea></td>
                </tr>
                <tr>
                    <td><?= translate('ITEM_DESC_3') ?>:</td>
                    <td><textarea name="row[desc3]" id="desc3" cols="50" rows="2"><?= $row['desc3'] ?></textarea></td>
                </tr>
                <tr>
                    <td><?= translate('ITEM_PRICE') ?>:</td>
                    <td><input type="text" name="row[sellPrice]" id="sellPrice" size="25" value="<?= $row['sellPrice'] ?>" /></td>
                </tr>
                <tr>
                    <td><?= translate('ITEM_LEVEL_LIMIT') ?>:</td>
                    <td><input type="text" name="row[level]" id="level" size="25" value="<?= $row['level'] ?>" /></td>
                </tr>
                <tr>
                    <td><?= translate('ITEM_LEVEL_FACTOR') ?>:</td>
                    <td><input type="text" name="row[equip_level_factor]" id="equip_level_factor" size="25" value="<?= $row['equip_level_factor'] ?>" /></td>
                </tr>
                <tr>
                    <td><?= translate('ITEM_FOLDUP_MAX') ?>:</td>
                    <td>
                        <input type="radio" name="row[foldupMax]" value="1" <?= checkchecked(1, $row['foldupMax']) ?> /> <?= translate('YES') ?>
                        <input type="radio" name="row[foldupMax]" value="0" <?= checkchecked(0, $row['foldupMax']) ?> /> <?= translate('UNKNOWN') ?>
                        <input type="radio" name="row[foldupMax]" value="-1" <?= checkchecked(-1, $row['foldupMax']) ?> /> <?= translate('NO') ?>
                    </td>
                </tr>
                <tr>
                    <td><?= translate('ITEM_RES') ?>:</td>
                    <td><input type="text" name="row[res]" id="res" size="25" value="<?= $row['res'] ?>" /></td>
                </tr>
                <tr>
                    <td><?= translate('ITEM_POINT') ?>:</td>
                    <td><textarea name="row[goodPoint]" id="" cols="30" rows="1"><?= $row['goodPoint'] ?></textarea></td>
                </tr>
                <tr>
                    <td><?= translate('SYNC') ?>:</td>
                    <td><?= $arealist ?></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input type="submit" value="<?= translate('SUBMIT') ?>" id="submit" /> <input type="reset" value="<?= translate('RESET') ?>" id="reset" /></td>
                </tr>
            </table>
        </form>
        <script type="text/javascript">
            SG.init("core.form", function() {
                $.formValidator.initConfig({formid: "#rowForm", submitonce: true});
                $("#id").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#name").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#itemType").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                $("#itemValue").formValidator({empty: false, onshow: '<?= translate('C_ONLY_NUM') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                $("#quality").formValidator({empty: false, onshow: '<?= translate('C_ONLY_NUM') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                $("#copperBuyPrice").formValidator({empty: false, onshow: '<?= translate('C_ONLY_NUM') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                $("#gesteBuyPrice").formValidator({empty: false, onshow: '<?= translate('C_ONLY_NUM') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                $("#goldBuyPrice").formValidator({empty: false, onshow: '<?= translate('C_ONLY_NUM') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                $("#equip_level_factor").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#level").formValidator({empty: false, onshow: '<?= translate('C_ONLY_NUM') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                $("#desc1").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#desc2").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#desc3").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#sellPrice").formValidator({empty: false, onshow: '<?= translate('C_ONLY_NUM') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                $("#res").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#goodPoint").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
            });
        </script>
    </body>
</html>